home *** CD-ROM | disk | FTP | other *** search
- Path: in2.uu.net!van-bc!usenet
- From: Ed Sargent <ed@metaxa.wimsey.com>
- Newsgroups: comp.lang.c++
- Subject: SPARC C++ 4.1 and STL
- Date: 22 Feb 1996 01:01:02 GMT
- Organization: I.C.B.C.
- Message-ID: <4ggf8e$c75@wolfe.wimsey.com>
- NNTP-Posting-Host: pm013.vcr.wis.net
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.1N (X11; I; SunOS 4.1.3_U1 sun4c)
- X-URL: news:comp.lang.c++
-
- Using :
-
- SPARCompiler C++ 4.1 on Solaris 2.5
-
- HP distribution of STL (October 31, 1995)
-
-
- I believe that this compiler is supposed to support the "public version"
- of the STL.
-
- I am trying to work my way through the some example programs that use the
- STL. About 95% of the examples compile and run successfully. However I am
- running into problems with the set and mset examples.
-
- For example, when I try to compile the following :
-
-
- //
- // SET0802.CPP
- //
-
- #include <iostream.h>
- #include "set.h"
-
- main()
- {
- int init[] = { 4, 10, 1, 3, 22, 1, 100, -100 };
- set<int, less<int> > a( init, init + 8 );
-
- cout << "a contains "
- << a.size()
- << " elements"
- << endl;
-
- cout << "The maximum size is "
- << a.max_size()
- << endl;
-
- cout << "a is "
- << ( a.empty() ? "" : "not " )
- << "empty"
- << endl;
-
- cout << "a contains : ";
- for ( set<int, less<int> >::iterator i = a.begin() ;
- i != a.end() ;
- i++ )
- cout << *i << " ";
- cout << endl;
-
- cout << "a reversed contains: ";
- set<int, less<int> >::reverse_iterator j;
- j = a.rbegin();
- while ( j != a.rend() )
- cout << *j++ << " ";
- cout << endl;
-
- return 1;
- }
-
-
- I get :
-
- + CC -c set0802.cpp -o set0802.o -I/project/lib/stl_book_examples -I/project/lib/stl
- -DMAIN
- "/project/lib/stl/set.h", line 108: Warning (Anachronism): Redefining set::iterator
- after use in rb_tree<int, int, ident<int, int>, less<int>>::rb_tree_node.
- "/project/lib/stl/set.h", line 108: Note: Type "CC -migration" for more on anachronisms.
- "/project/lib/stl/set.h", line 38: Where: While specializing "rb_tree<int, int,
- ident<int, int>, less<int>>".
- "/project/lib/stl/set.h", line 38: Where: Specialized in set<int, less<int>>.
- "set0802.cpp", line 11: Where: Specialized in non-template code.
- "/project/lib/stl/set.h", line 105: Warning (Anachronism): Redefining set::iterator
- after use in rb_tree<int, int, ident<int, int>, less<int>>::rb_tree_node.
- "/project/lib/stl/set.h", line 38: Where: While specializing "rb_tree<int, int,
- ident<int, int>, less<int>>".
- "/project/lib/stl/set.h", line 38: Where: Specialized in set<int, less<int>>.
- "set0802.cpp", line 11: Where: Specialized in non-template code.
- "/project/lib/stl/set.h", line 103: Warning (Anachronism): Redefining set::iterator
- after use in rb_tree<int, int, ident<int, int>, less<int>>::rb_tree_node.
- "/project/lib/stl/set.h", line 38: Where: While specializing "rb_tree<int, int,
- ident<int, int>, less<int>>".
- "/project/lib/stl/set.h", line 38: Where: Specialized in set<int, less<int>>.
- "set0802.cpp", line 11: Where: Specialized in non-template code.
- "/project/lib/stl/set.h", line 83: Warning (Anachronism): Redefining set::iterator after
- use in rb_tree<int, int, ident<int, int>, less<int>>::rb_tree_node.
- "/project/lib/stl/set.h", line 38: Where: While specializing "rb_tree<int, int,
- ident<int, int>, less<int>>".
- "/project/lib/stl/set.h", line 38: Where: Specialized in set<int, less<int>>.
- "set0802.cpp", line 11: Where: Specialized in non-template code.
- "set0802.cpp", line 28: Error: Unexpected type name "set<int, less<int>>::iterator"
- encountered.
- "set0802.cpp", line 28: Error: i is not defined.
- "set0802.cpp", line 28: Error: Badly formed expression.
- "set0802.cpp", line 30: Error: i is not defined.
- "set0802.cpp", line 30: Error: Unexpected ")" -- Check for matching parenthesis.
- "set0802.cpp", line 30: Error: Use ";" to terminate statements.
- "set0802.cpp", line 30: Error: "}" expected instead of ")".
- "set0802.cpp", line 35: Error: Unexpected type name "set<int,
- less<int>>::reverse_iterator" encountered.
- "set0802.cpp", line 35: Error: j is not defined.
- "set0802.cpp", line 35: Error: Badly formed expression.
- "set0802.cpp", line 36: Error: j is not defined.
- "set0802.cpp", line 37: Error: j is not defined.
- "set0802.cpp", line 38: Error: j is not defined.
- 13 Error(s) and 4 Warning(s) detected.
- *** Error code 13
- make: Warning: Target `all' not remade because of errors
-
-
- However, if I comment out that last two sections of the program that use
- iterators, then I stil get the warnings but no errors, and the program
- runs OK.
-
- Additionally, I get other errors with other examples.
-
- Is anybody using the public domain STL with SPARC C++ 4.1? What are the
- requirments to do so successfully?
-
- Thanks, Ed
-
-
-
-
-
-
-
-
- --
- ***************************************************************************
- * *
- * Ed Sargent ed@metaxa.wimsey.com *
- * Corporate Actuarial Dept. *
- * Insurance Corporation of B.C. *
- * N. Vancouver, B.C., Canada *
- * *
- ***************************************************************************
-
-